#include <bits/stdc++.h>

using namespace std;
 
bool isrevers(string s){
    string tmp=s;
    reverse(s.begin(),s.end());
    return s==tmp;
}

bool dfs(string ret,vector<string>& s,int k)
{
    if(k==s.size()){
        if(isrevers(ret)) return true;
        return false;
    }
    for(int i=0;i<s[k].size();i++){
        ret += s[k][i];
        if(dfs(ret,s,k+1)) return true;
        ret.pop_back();
    }
    return false;
}
int main()
{
    int t;cin>>t;
    while(t--){
        int n;
        cin>>n;
        vector<string> s(n);
        for(int i=0;i<n;i++) cin>>s[i];
        string ret;
        if(dfs(ret,s,0)){
            cout << "Yes" <<endl;
        }
        else{
            cout << "No" <<endl;
        }
    }
    return 0;
}1
